import { _decorator, Component, Node } from 'cc';
import { LayerAction } from './LayerAction';
import { Tools } from './Tools';
import { Globals } from './Globals';
const { ccclass, property } = _decorator;

@ccclass('LevelAction')
export class LevelAction extends Component {
    
    start() {

    }

    update(deltaTime: number) {
        
    }

    initLevel() {

        // 初始化关卡
        for (let i = 0; i < this.node.children.length; i++) {
            const layerNode = this.node.children[i];
            let groupId = Tools.getGroup(i);
            let layerColor = Globals.colors[i];
            layerNode.getComponent(LayerAction).initLayer(groupId, layerColor);
        }
    }
}


